from wormbane.language import add_indefinite_article


class Thing(object):

    count = 1
    color = 'black'

    def __init__(self):
        self.env = None

    @property
    def tile(self):
        env = self.env
        return None if env is None else env.tile

    @property
    def pos(self):
        env = self.env
        return None if env is None else env.pos

    @property
    def level(self):
        env = self.env
        return None if env is None else env.level

    @property
    def plural(self):
        return self.count != 1

    def __str__(self):
        return add_indefinite_article(type(self).__name__.lower())
